home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
cgraphix
/
cmovwind.c
< prev
next >
Wrap
Text File
|
1986-05-28
|
1KB
|
84 lines
/* «RM120»«PL99999»«TS4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76» */
#include <stdio.h>
#define EXTERN extern
#include <typedef.h>
void DrawLines()
{
int i;
for (i = 1; i <= 20; i++)
DrawLine(50.*i, 0., 1000.-50.*i, 50.*i);
}
main()
{
int i;
int key;
InitGraphic(); /* init the system and screen */
DrawBorder();
DefineWindow(1, (int)(XMaxGlb/10), (int)(YMaxGlb/10),
(int)(XMaxGlb/2), (int)(YMaxGlb/2));
DefineHeader(1, "THIS IS THE FIXED WINDOW");
DefineWorld(1, 0., 0., 1000., 1000.);
DefineWindow(2, (int)(XMaxGlb/2), (int)(YMaxGlb/2),
(int)(9 * XMaxGlb/10), (int)(9*YMaxGlb/10));
DefineHeader(2, "THIS IS THE MOVEABLE WINDOW");
DefineWorld(2, 0., 0., 1000., 1000.);
SelectWorld(1);
SelectWindow(1);
SetHeaderOn();
SetBackground(0);
DrawBorder();
DrawLines();
CopyScreen();
SetBreakOff();
SetMessageOff();
SelectWorld(2);
SelectWindow(2);
SetHeaderOn();
SetBackground(0);
DrawBorder();
DrawLines();
VStepGlb = 2;
while (1) {
key = 0;
key = inkey();
fflush(stdin);
switch(key) {
case '8':
case -72:
MoveVer(-4, TRUE);
break;
case '4':
case -75:
MoveHor(-1, TRUE);
break;
case '6':
case -77:
MoveHor(1, TRUE);
break;
case '2':
case -80 :
MoveVer(4, TRUE);
break;
case ' ':
LeaveGraphic();
exit(1);
break;
default:
break;
}
}
}